//
//  WYHttpServer+WYMedia.m
//  CirclePush
//
//  Created by admin on 2018/5/8.
//  Copyright © 2018年 admin. All rights reserved.
//

#import "WYHttpServer+WYMedia.h"

@implementation WYHttpServer (WYMedia)
+(void)getMediaTypeSucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlGetMediaType WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
}
+(void)getMediaTypeWithTypeId:(NSString *)typeID  SucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    
    [parm setValue:typeID forKey:@"typeId"];
    
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlGetAttrByTypeId WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
}
+(void)getCityListWithState:(NSString *)state WithSearchName:(NSString *)search  SucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    
    [parm setValue:state forKey:@"state"];
    [parm setValue:search forKey:@"search"];
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlGetCityList WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
}
+(void)getMediaListWithSearchParam:(NSString *)searchParam WithPageNum:(NSString *)pageNum WithPageSize:(NSString *)pageSize SucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    
    [parm setValue:searchParam forKey:@"searchParam"];
    [parm setValue:pageNum forKey:@"pageNum"];
    [parm setValue:pageSize forKey:@"pageSize"];
    
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlGetMediaList WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
    
    
    
    
}

+(void)getMediaDetailWithID:(NSString *)ID SucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    [parm setValue:ID forKey:@"id"];
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlGetMediaDetail WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
    
    
    
    
    
    
}
+(void)getMediaSuccessWithPageNum:(NSString *)pageNum WithPageSize:(NSString *)pageSize SucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    
   // [parm setValue:searchParam forKey:@"searchParam"];
    [parm setValue:pageNum forKey:@"pageNum"];
    [parm setValue:pageSize forKey:@"pageSize"];
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlGetSuccessList WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
    
    
    
    
}









@end
